const Ajax = window.ajaxAuth;
const bAjax = window.ajaxbusinessAssets;
const aAjax = window.ajaxAuth
const pAjax = window.ajaxFinancialplan
const cAjax = window.ajaxBusinessContract
import encrypt from '@/lib/uas-encrypt';

//字典
export const apiCommonData = (params) => Ajax.request(`/v1/business/dict/info/list`, 'post', params, {
  showLoading: true
});
//公共常量
export const apiSecurity = () => Ajax.request(`/v1/frameworks/systems/user/security`, 'get', '', {
  showLoading: true
});
//发送验证码
export const apiSendCode = (phone) => Ajax.request(`/v1/frameworks/systems/user/send/verification/code`, 'post', encrypt({
  phone
}), {
  showLoading: true
});
//公共常量
export const apiDictionary = () => Ajax.request(`/v1/constant`, 'get', '', {
  showLoading: true
});
// 获取Token
export const apiHostList = (param) => Ajax.request('/v1/frameworks/systems/security', 'post', param, {
  showLoading: true
});
//平台菜单新增
export const apiMenuInfoCreate = (param) => Ajax.request('/v1/business/menu/info', 'post', param, {
  showLoading: true
});
//平台菜单删除
export const apiMenuInfoDelete = (param) => Ajax.request(`/v1/business/menu/info/${param}`, 'delete', {}, {
  showLoading: true
});
//平台菜单更新
export const apiMenuInfoUpdate = (param) => Ajax.request('/v1/business/menu/info', 'put', param, {
  showLoading: true
});
//平台菜单树
export const apiMenuInfoTree = (param) => Ajax.request('/v1/business/menu/info/tree', 'post', param, {
  showLoading: true
});

//权限中心列表
export const apiEnterpriseList = (param) => Ajax.request('/v1/business/enterprise/info/list', 'post', param, {
  showLoading: true
});
//组织信息
export const apiEnterpriseInfo = (param) => Ajax.request(`/v1/business/enterprise/info/businessDetail/${param}`, 'get', '', {
  showLoading: true
});
//组织信息新增
export const apiEnterpriseAdd = (param) => Ajax.request('/v1/business/enterprise/info', 'post', param, {
  showLoading: true
});
//组织信息更新
export const apiEnterpriseEdit = (param) => Ajax.request(`/v1/business/enterprise/info`, 'put', param, {
  showLoading: true
});
//组织信息删除
export const apiEnterpriseDel = (param) => Ajax.request(`/v1/business/enterprise/info/${param}`, 'delete', '', {
  showLoading: true
});

//组织树
export const apiOrganizationTree = (param) => Ajax.request('/v1/business/oms/node/human/trees/employeePosition', 'post', param, {
  showLoading: true
});
//添加人员
export const apiPersonAdd = (param) => Ajax.request('/v1/business/org/employee/createOrUpdate', 'post', param, {
  showLoading: true
});
//编辑人员
export const apiPersonEdit = (param) => Ajax.request(`/v1/business/org/employee/createOrUpdate`, 'post', param, {
  showLoading: true
});
//删除人员
export const apiPersonDel = (param) => Ajax.request(`/v1/business/org/employee/delete
`, 'post', param, {
  showLoading: true
});
//详情人员
export const apiPersonInfo = (param) => Ajax.request('/v1/business/org/employee/detail', 'post', param, {
  showLoading: true
});
//岗位权限树
export const apiPostTree = (param) => Ajax.request('/v1/business/menu/info/role/tree', 'post', param, {
  showLoading: true
});
//岗位权限树
export const apiRoleTree = (param) => Ajax.request('/v1/business/menu/info/tree', 'post', param, {
  showLoading: true
});
//给岗位绑定权限
export const apiDoAuth = (param) => Ajax.request('/v1/business/menu/biz/map', 'post', param, {
  showLoading: true
});

//列表岗位
export const apiJoList = (param) => Ajax.request('/v1/business/oms/position/list', 'post', param, {
  showLoading: true
});
//添加岗位
export const apiJobAdd = (param) => Ajax.request('/v1/business/oms/position', 'post', param, {
  showLoading: true
});
//编辑岗位
export const apiJobEdit = (param) => Ajax.request('/v1/business/oms/position', 'put', param, {
  showLoading: true
});
//删除岗位
export const apiJobDel = (param) => Ajax.request(`/v1/business/oms/position/${param}`, 'delete', '', {
  showLoading: true
});
//详情岗位
export const apiJobInfo = (param) => Ajax.request(`/v1/business/oms/position/${param}`, 'get', '', {
  showLoading: true
});

//添加组织
export const apiGroupAdd = (param) => Ajax.request('/v1/business/oms/node', 'post', param, {
  showLoading: true
});
//编辑组织
export const apiGroupEdit = (param) => Ajax.request(`/v1/business/oms/node`, 'put', param, {
  showLoading: true
});
//删除组织
export const apiGroupDel = (param) => Ajax.request(`/v1/business/oms/node/delete`, 'post', param, {
  showLoading: true
});
//详情组织
export const apiGroupInfo = (param) => Ajax.request(`/v1/business/oms/node/${param}`, 'get', '', {
  showLoading: true
});

//列表标签
export const apiTagList = (param) => Ajax.request('/v1/business/tag/list', 'post', param, {
  showLoading: true
});
//添加标签
export const apiTagAdd = (param) => Ajax.request('/v1/business/tag', 'post', param, {
  showLoading: true
});
//编辑标签
export const apiTagEdit = (param) => Ajax.request('/v1/business/tag', 'put', param, {
  showLoading: true
});
//删除标签
export const apiTagDel = (param) => Ajax.request(`/v1/business/tag/${param}`, 'delete', '', {
  showLoading: true
});

//离职管理
export const apiDimissionList = (param) => Ajax.request('/v1/user/list', 'post', param, {
  showLoading: true
});
//离职管理 禁用
export const apiDimissionBan = (param) => Ajax.request('/v1/user/disable', 'post', param, {
  showLoading: true
});
//离职管理 启用
export const apiDimissionEnable = (param) => Ajax.request('/v1/user/undisable', 'post', param, {
  showLoading: true
});
//离职管理 注销
export const apiDimissionLogout = (param) => Ajax.request('/v1/user/cancel', 'post', param, {
  showLoading: true
});

//操作日志
export const apiLog = (param) => Ajax.request('/v1/behavior/log/list', 'post', param, {
  showLoading: true
});

//组织中的菜单管理数据源
export const apiMenuGroupTree = (param) => Ajax.request('/v1/business/menu/manage', 'post', param, {
  showLoading: true
});
//组织中的菜单新增
export const apiMenuGroupAdd = (param) => Ajax.request('/v1/business/menu/manage/create', 'post', param, {
  showLoading: true
});
//组织中的菜单修改
export const apiMenuGroupEdit = (param) => Ajax.request('/v1/business/menu/manage/update', 'put', param, {
  showLoading: true
});
//组织中的菜单删除
export const apiMenuGroupDel = (param) => Ajax.request('/v1/business/menu/manage/delete', 'post', param, {
  showLoading: true
});
//获取指定目录的子集
export const apiMenuSonList = (param) => Ajax.request('/v1/business/menu/info/list', 'post', param, {
  showLoading: true
});

//企查查查询企业基本要素
export const apiQiChacha = (param) => Ajax.request('/v1/qiChaCha/fuzzy/search', 'post', param, {
  showLoading: true
});

//手机验证
export const apiVerifyPhone = (param) => Ajax.request('/v1/validate/verification/code', 'post', param, {
  showLoading: true
});

//搜索人
export const apiUserList = (param) => Ajax.request('/v1/business/oms/employee/list', 'post', param, {
  showLoading: true
});
//导入组织
export const apiGroupImport = (param) => Ajax.request('/v1/business/oms/employ/import', 'post', param, {
  showLoading: true
});

//菜单克隆
export const apiMenuClone = (param) => Ajax.request('/v1/business/menu/manage/clone', 'post', param, {
  showLoading: true
});


//业态配置
export const categoryCreate = (params) => bAjax.request(`/v1/business/category/map/batchCreate`, 'post', params, {
  showLoading: true
});
export const categoryDetail = (params) => bAjax.request(`/v1/business/category/map/detailByBizId`, 'post', params, {
  showLoading: true
});
export const categoryTree = (params) => bAjax.request(`/v1/business/category/tree`, 'post', params, {
  showLoading: true
});
export const categoryUpdate = (params) => bAjax.request(`/v1/business/category/map/merge`, 'post', params, {
  showLoading: true
});
//事项配置
export const businessConstant = (params) => pAjax.request(`/v1/constant`, 'get', '', {
  showLoading: true
});
export const bussinessTree = (params) => pAjax.request(`/v1/business/charge/item/tree`, 'post', params, {
  showLoading: true
});
export const bussinessDetail = (params) => pAjax.request(`/v1/business/charge/item/biz/map/detailByBizId`, 'post', params, {
  showLoading: true
});
export const bussinessUpdate = (params) => pAjax.request(`/v1/business/charge/item/biz/map/merge`, 'post', params, {
  showLoading: true
});
export const bussinessCreated = (params) => pAjax.request(`/v1/business/charge/item/biz/map/mergeBatch`, 'post', params, {
  showLoading: true
});
//岗位列表
export const organizationList = (params) => bAjax.request(`/v1/business/organization/position/list`, 'post', params, {
  showLoading: true
});


//企业认证
export const enterpriseDetaile = (params) => aAjax.request(`/v1/business/enterprise/validate/enterpriseDetail`, 'post', params, {
  showLoading: true
});
//发送短信验证
export const sendValidateSms = (params) => aAjax.request(`/v1/business/enterprise/validate/sendValidateSms`, 'post', params, {
  showLoading: true
});
//发送验证邮件 
export const apiVerifyEmail = (params) => aAjax.request(`/v1/business/enterprise/validate/sendValidateMail`, 'post', params, {
  showLoading: true
});
// 短信验证/邮箱验证
export const apiVerifyedSmsEmail = (params) => Ajax.request(`/v1/business/enterprise/validate/validate`, 'post', params, {
  showLoading: true
});

//预算配置新增
export const apiBudgetAdd = (param) => pAjax.request('/v1/basic/financialplan/subject/info/create', 'post', param, {
  showLoading: true
});

//预算配置编辑
export const apiBudgetUpdate = (param) => pAjax.request('/v1/basic/financialplan/subject/info/update', 'post', param, {
  showLoading: true
});

//预算配置删除
export const apiBudgetDelete = (param) => pAjax.request('/v1/business/subject/info/delete', 'post', param, {
  showLoading: true
});

//预算配置tree
export const apiBudgetTree = (param) => pAjax.request('/v1/basic/financialplan/subject/info/tree', 'post', param, {
  showLoading: true
});

//预算配置导入
export const apiBudgeImport = (param) => pAjax.uploadParam('/v1/business/subject/import', param, {
  showLoading: true
});

//预算配置导入
export const apiChargeList = (param) => pAjax.request('/v1/business/charge/item/biz/map/list', 'post', param, {
  showLoading: true
});

//租赁合同导入
export const apiContractLeaseImport = (param) => cAjax.uploadParam('/v1/business/contract/import', param, {
  showLoading: true
});

//广告合同导入
export const apiContractAdImport = (param) => cAjax.uploadParam('/v1/business/ad/contract/import', param, {
  showLoading: true
});

//临时场地合同导入
export const apiContractPlaceImport = (param) => cAjax.uploadParam('/v1/business/temporaryVenue/contract/import', param, {
  showLoading: true
});

//停车合同导入
export const apiContractParkImport = (param) => cAjax.uploadParam('/v1/business/carPark/contract/import', param, {
  showLoading: true
});

//支出合同导入
export const apiContractPayImport = (param) => cAjax.uploadParam('/v1/business/expend/contract/import', param, {
  showLoading: true
});

//付款导入
export const apiContractPaymentImport = (param) => cAjax.uploadParam('/v1/business/payment/Record/import', param, {
  showLoading: true
});

//合同附件绑定后的导入
export const apiContractFileImport = (param) => cAjax.uploadParam('/v1/business/contract/file/import', param, {
  showLoading: true
});

//合同附件批量保存附件的key
export const apiContractFileKeys = (param) => cAjax.request('/v1/business/contract/file/upload/batch', "post", param, {
  showLoading: true
});

//账单导入
export const apiContractBillImport = (param) => cAjax.uploadParam('/v1/business/bill/contract/import', param, {
  showLoading: true
});

//收入核算导入
export const apiIncomeImport = (param) => cAjax.uploadParam('/v1/projectFinance/accounting/incomeImport', param, {
  showLoading: true
});

//支出核算导入
export const apiPaymentImport = (param) => cAjax.uploadParam('/v1/projectFinance/accounting/paymentImport', param, {
  showLoading: true
});

//支出记录导入
export const apiPayRecordImport = (param) => cAjax.uploadParam('/v1/business/payable/importV2', param, {
  showLoading: true
});

//下载绑定关系的合同附件excle
export const apiContractFileDownload = (param) => cAjax.download('/v1/business/contract/file/export', param, {
  showLoading: true,
  responseType: 'blob'
});

//绑定合同和附件
export const apiContractFileBind = (param) => cAjax.request('/v1/business/contract/file/upload', 'post', param, {
  showLoading: true,
  responseType: 'blob'
});

//费项子项新增
export const apiMatterChildAdd = (param) => pAjax.request('/v1/business/charge/item/child/create', 'post', param, {
  showLoading: true
});

//费项子项删除
export const apiMatterChildDelete = (param) => pAjax.request('/v1/business/charge/item/child/delete', 'post', param, {
  showLoading: true
});

//费项子项更新
export const apiMatterChildUpdate = (param) => pAjax.request('/v1/business/charge/item/child/update', 'post', param, {
  showLoading: true
});

//费项子项list
export const apiMatterChildList = (param) => pAjax.request('/v1/business/charge/item/child/list', 'post', param, {
  showLoading: true
});

//导出计划
export const apiExportPlan = (params) => pAjax.download(`/v1/business/plan/item/export`, params, {
  showLoading: true,
  responseType: 'blob'
});

//导入计划
export const apiImportPlan = (params) => pAjax.uploadParam(`/v1/business/plan/item/import`, params, {
  showLoading: true
});

//现金流 / 利润推送
export const apiCashPush = (params) => pAjax.request(`/v1/business/PlanCompile/startPlanMonthFilling`,'post',  params, {
  showLoading: true
});